package bishi;

import java.util.*;
import java.util.concurrent.Executors;

/**
 * @Author liuhaoqi
 * @Date 2020/9/13 15:26
 * @Version 1.0
 */
public class CCF20200901_2 {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int x = scanner.nextInt();
        int y = scanner.nextInt();
        int[][] arr = new int[n][2];
        for (int i = 0; i < n; i++) {
            arr[i][0] = scanner.nextInt();
            arr[i][1] = scanner.nextInt();
        }
        ArrayList<String> list = new ArrayList<>();
        for (int i = 0; i < arr.length; i++) {
            int t = (arr[i][0] - x) * (arr[i][0] - x) + (arr[i][1] - y) * (arr[i][1] - y);
            list.add(i + 1 + "#" + t);
        }
        list.sort((o1, o2) -> {
            int a = Integer.parseInt(o1.split("#")[1]);
            int b = Integer.parseInt(o2.split("#")[1]);
            return a - b;
        });
        for (int i = 0; i < 3; i++) {
            int index = Integer.parseInt(list.get(i).split("#")[0]);
            System.out.println(index);
        }
    }
}
